<template>
  <!-- component的is属性为元素名 -->
  <component :is="isDiv?'div':'span'">标准HTML元素</component>

  <!-- component的is属性为组件名 -->
  <component :is="componentChildrenName"/>
</template>

<script>
import {defineComponent} from 'vue';
import ComponentChildren from '@/components/component/ComponentChildren.vue';

export default defineComponent({
  name: 'Component',
  components: {ComponentChildren},
  data() {
    return {
      componentChildrenName: ComponentChildren,
      isDiv: true,
    };
  }
});
</script>

<style scoped>

</style>